package model;
import java.util.Date;
public class BorrowRecord {
    private Book book;
    private Reader reader;
    private Date borrowTime;
    private Date returnTime;
    public BorrowRecord(Book book, Reader reader) {
        this.book = book;
        this.reader = reader;
        this.borrowTime = new Date();
        this.returnTime = null;
    }
    public void setReturnTime() {
        this.returnTime = new Date();
    }
    public Reader getReader() {
        return reader;
    }
    @Override
    public String toString() {
        return book.getIsbn() + "," + reader.getReaderId() + "," + borrowTime + "," + (returnTime == null ? "未还书" : returnTime);
    }
}